home *** CD-ROM | disk | FTP | other *** search
- ; ****************************************
- ; ** INTRO NUMBER 5 (C) 1990 CRYPTIC UK **
- ; ** CODED BY: TANGO **
- ; ** MUSIC BY: COUNT **
- ; ****************************************
-
- opt c-
- section blitter,code_c Chip Ram please !!
- include df1:definitions Give me some hardware reggies
- include df1:macros Give me some macros
-
-
- ;LOCAL CONSTANTS
-
- icra equ $bfed01
- allocmem =-30-168
- freemem =-30-180
- fontmemory =4000
-
-
- TAKEOVER:
-
- LEA custom,a5
- LEA GFXLIB(PC),a1 Point to 'graphics.library'
- MOVEQ #0,D0 Doesn't matter which version
- MOVE.L 4.w,a6 EXECBASE
- jsr -132(a6) task switching off (forbid)
- JSR -$228(a6) Openlibrary
- MOVE.L D0,GFXBASE Store library address
-
-
- ;Now put the graphic addresses in the CopperList
-
- move.l screenx,d1 Bitplane memory address
- move.w d1,bp1lo+2 for scroll 1.
- swap d1
- move.w d1,bp1hi+2
-
- move.l screeny,d1 Bitplane memory address
- move.w d1,abp1lo+2 for scroll 2.
- swap d1
- move.w d1,abp1hi+2
-
-
- move.l GFXBASE,d0 Move gfxbase offset to d0
- MOVE.L D0,A6
- MOVE.W #$80,dmacon(a5) Turn off copper whilst changing it
- MOVE.L $32(A6),WBCOPPER Store old (WBench) copper address
- MOVE.L #OURCOPPER,$32(A6) Point to new copper list (our own)
- MOVE.W #$8080,dmacon(a5) Re-enable copper
- MOVE.W #$8010,intena(a5)
- MOVE.L $6c,old Save work bench interrupt
- MOVE.L #LEV3,$6c Point to were to set up interrupt
- move.w intenar(a5),systemints
- move.b #%01111111,icra Kill keyboard.
-
- WAIT:
- BTST #6,$BFE001 This waits for the left
- BNE.S WAIT mouse button to be pressed
- move.l 4.w,a6 EXECBASE
- MOVE.L old,$6c Restore system interrupts
- MOVE.L GFXBASE,A6
- MOVE.W #$80,dmacon(a5) Disable DMA
- MOVE.L WBCOPPER,$32(A6) Restore old copperlist
- MOVE.W #$8080,dmacon(a5) Enable DMA
- move.w systemints,d0 Systems interrupt
- or.w #$c000,d0
- move.w d0,intena(a5) Enable OS interrupts
- move.b #%10011011,icra Enable keyboard
- clr.w $dff0a8 Clear music
- clr.w $dff0b8
- clr.w $dff0c8
- clr.w $dff0d8
- move.w #$f,$dff096
- rts
-
-
- ERROR:
- move.l 4.w,a6 Get EXECBASE
- jsr -138(a6) Permit ( multi-tasking on )
- moveq #0,d0 Clear d0
- RTS Return to AmigaDOS
-
-
- ;This is the NEW level 3 interrupt
-
- LEV3:
- Save_all Save all registers to the stack
- lea custom,a5
- AND #$10,intreqr(a5) Check if interrupt is from Copper
- BNE out
- move.w #$8010,$9c Cause Copper interrupt
-
- ; ** Main Routines called every VBI **
-
- bsr testscroll
- bsr testscroll2
- bsr bounce2
- bsr bounce
-
- out:
- Return_all
- DC.W $4ef9 hex value for JMP instruction
- old:
- DC.L 0 will jump to normal interrupt
-
-
- ; ** THE SCROLL ROUTINE **
-
- testscroll:
- tst.l stopper
- beq.s scroll
- sub.l #1,stopper
- rts
- scroll:
- cmp.l #15,val Blitshifted all <<<
- blo.s coarse_scroll_it No then get doing it !!
- bsr blit_char Blit letter to screen
- clr.l val Reset index
- coarse_scroll_it:
- bsr coarse Scroll all line
- rts
-
- testscroll2:
- tst.l stopper2 Test for pause.
- beq.s scroll2
- sub.l #1,stopper2
- rts
- scroll2:
- cmp.l #15,val2 Blitshifted all <<<
- blo.s coarse_scroll_it2 No then get doing it blitter man !!
- bsr blit_char2 Blit letter to screen
- clr.l val2 Reset index
- coarse_scroll_it2:
- bsr coarse2 Scroll all line
- rts
-
-
- ; ** BLIT LETTER ON THE SCREEN **
-
- blit_char
- jsr text
- lea custom,a5 Get custom chip address
- move.l screenx,a0 The screen on which scrolly is.
- move.l #font,a1 Put font in blitter source
- add.l d1,a1
- blit_test:
- btst #14,$dff002 Blitter busy !!!
- bne blit_test Lets wait till she finishes !
- move.w #$ffff,bltafwm(a5) Mask
- move.w #$ffff,bltalwm(a5) Mask
- move.l a0,bltdpth(a5) Blitter dest D (BOTTOM OF SCREEN)
- move.l a1,bltapth(a5) Blitter source A (SCROLLING FONT)
- move.w #38,bltamod(a5) Modulo (20-1)*2
- move.w #38,bltdmod(a5) Modulo (20-1)*2
- move.w #$9f0,bltcon0(a5) Minterms D=A
- clr.w bltcon1(a5) Set Ascending mode
- move.w #16*64+1,bltsize(a5) Blit size (SIZE OF FONT)
- rts Return
-
-
- ; ** BLITSHIFT THE ENTIRE SCROLL LINE **
- ;
- ; FUNCTION: TO BARREL SHIFT THE ENTIRE SCROLLING MESSAGE.
-
- coarse:
- lea custom,a5
- move.l screenx,a0
- move.l a0,a1
- add.l #2,a1
- blit_wait:
- btst #14,$dff002
- bne blit_wait
- incl #4,val
- move speed,d7
- ror #4,d7 ; Set to correct bits (12-15)
- or #%100111110000,d7 ; MINTERM D=A ($9F0)
- move.l #-1,bltafwm(a5)
- move.l a1,bltapth(a5)
- move.l a0,bltdpth(a5)
- move.w #0,bltamod(a5)
- move.w #0,bltdmod(a5)
- move.w d7,bltcon0(a5)
- move.w #20*64+20,bltsize(a5)
- rts
-
- speed: dc.w 12
-
-
- ; ** SCROLL NUMBER TWO **
- ;
- ; DOCUMENTED IN SCROLL NUMBER ONE.
-
- blit_char2:
- jsr text2
- lea custom,a5
- move.l screeny,a0
- move.l #font,a1
- add.l d1,a1
- blit_test2:
- btst #14,$dff002
- bne blit_test2
- move.w #$ffff,bltafwm(a5)
- move.w #$ffff,bltalwm(a5)
- move.l a0,bltdpth(a5)
- move.l a1,bltapth(a5)
- move.w #38,bltamod(a5)
- move.w #38,bltdmod(a5)
- move.w #$9f0,bltcon0(a5)
- clr.w bltcon1(a5)
- move.w #16*64+1,bltsize(a5)
- rts
-
- coarse2:
- lea custom,a5
- move.l screeny,a0
- move.l a0,a1
- add.l #2,a1
- blit_wait2:
- btst #14,$dff002
- bne blit_wait2
- incl #4,val2
- move speed2,d7
- ror #4,d7
- or #%100111110000,d7
- move.l #-1,bltafwm(a5)
- move.l a1,bltapth(a5)
- move.l a0,bltdpth(a5)
- move.w #0,bltamod(a5)
- move.w #0,bltdmod(a5)
- move.w d7,bltcon0(a5)
- move.w #20*64+20,bltsize(a5)
- rts
-
- speed2: dc.w 12
-
-
- ; ** THIS CRAPPY CODE BOUNCES THE SCROLLY MESSAGE NUMBER TWO **
- ;
- ; ENTRYS : YCORD-HOW FAR UP AND DOWN SCREEN TO GO.
- ; : DELTAY-WAIT COMMAND IN COPPERLIST.
- ; FUNCTION: BOUNCE THE SCROLLY MESSAGE.
-
- bounce:
- cmp.l #63,ycord
- beq.s up
- add.l #1,ycord
- sub.b #1,deltay
- rts
- up: cmp.l #63,ycordminus
- beq.s rst_cord
- add.l #1,ycordminus
- add.b #1,deltay
- rts
- rst_cord:
- clr.l ycord
- clr.l ycordminus
- rts
-
- ycord: dc.l 0
- ycordminus: dc.l 0
- even
-
-
- ; ** THIS CRAPPY CODE BOUNCES SCROLLY MESSAGE NUMBER ONE (ONE AT THE TOP) **
- ;
- ; ENTRYS : YCORD2-HOW FAR UP AND DOWN SCREEN TO GO.
- ; : DELTAY2-WAIT COMMAND IN COPPERLIST.
- ; FUNCTION: BOUNCE THE SCROLLY MESSAGE.
-
- bounce2:
- cmp.l #63,ycord2
- beq.s up2
- add.l #1,ycord2
- add.b #1,deltay2
- rts
- up2:cmp.l #63,ycordminus2
- beq.s rst_cord2
- add.l #1,ycordminus2
- sub.b #1,deltay2
- rts
- rst_cord2:
- clr.l ycord2
- clr.l ycordminus2
- rts
-
- ycord2: dc.l 0
- ycordminus2:dc.l 0
- even
-
-
- ; ** CHARACTER DECODER ROUTINE **
-
- text:
- move.l acurent,a2 Get message
- clr.l d1
- move.b (a2)+,d1 Update it
- move.b d1,letter Store in offset
- cmp.b #255,d1 Check for end of message
- beq.w rst_text If equal, then reset
- cmp.b #254,d1
- beq stop
- sub.l #32,d1 Subract 32 (ie space)
- asl d1 Times by 2
- move.l a2,acurent Update acurent
- CMP.B #"4",letter Is letter "K" or larger
- BPL.s add_more If larger then add on
- rts Return
- add_more:
- CMP.B #"H",letter Is letter "U" or larger
- BPL.S add_more2 If larger then add on
- add.l #40*15,d1 Get next line down (KLMNOPQRST)
- rts
- add_more2:
- add.l #40*30,d1 Get next line down (UVWXYZ0123)
- rts
- rst_text:
- move.l #0,d1
- move.l #message,d2 Get begining of text
- move.l d2,acurent Reset to begining
- rts Return
- stop:
- move.l #0,d1
- add.l #1,acurent
- move.l #150,stopper
- rts
-
- ; ** CHARACTER DECODER ROUTINE NUMBER TWO ! **
-
- text2:
- move.l acurent2,a2
- clr.l d1
- move.b (a2)+,d1
- move.b d1,letter2
- cmp.b #255,d1
- beq.w rst_text2
- cmp.b #254,d1
- beq stop2
- sub.l #32,d1
- asl d1
- move.l a2,acurent2
- CMP.B #"4",letter2
- BPL.s add_more20
- rts
- add_more20:
- CMP.B #"H",letter2
- BPL.S add_more30
- add.l #40*15,d1
- rts
- add_more30:
- add.l #40*30,d1
- rts
- rst_text2:
- move.l #0,d1
- move.l #message2,d2
- move.l d2,acurent2
- rts
- stop2:
- move.l #0,d1
- add.l #1,acurent2
- move.l #150,stopper2
- rts
-
-
- ; ** THE FIRST MESSAGE **
-
- message:
- ; 254=STOP,255=END.
- DC.B " INTRO CODED BY TANGO "
- DC.B " CRYPTIC UK ",254
- DC.B 255
- EVEN
-
-
- ; ** THE SECOND MESSAGE **
-
- message2:
- ; 254=STOP,255=END.
- DC.B " INTRO CODED BY TANGO "
- DC.B " CRYPTIC UK ",254
- DC.B " THIS IS SCROLLER 2 AND ITS BLITSHIFTED"
- DC.B " IT ALSO HAS THE ABILITY TO..... "
- DC.B " STOP ! ",254
- DC.B 255
- EVEN
-
-
- ; ** THE COPPERLIST **
-
- OURCOPPER:
- dc.w $120,0
- dc.w $122,0
- dc.w bpl1mod,0,bpl2mod,0
- dc.w diwstrt,$2c81+16,diwstop,$2cc1
- dc.w bplcon0,$1200,bplcon1,$0000
- dc.w ddfstrt,$38,ddfstop,$d0
- dc.w color00,$000,color01,$000
- deltay2:wait $3009,$fffe
- dc.w color01,$f44
- bp1lo: dc.w bpl1ptl,$0000
- bp1hi: dc.w bpl1pth,$0000
- deltay: wait $c009,$fffe
- abp1lo: dc.w bpl1ptl,$0000
- abp1hi: dc.w bpl1pth,$0000
- end_copper
-
-
- ;LOCAL CONSTANTS
-
- WBCOPPER: DC.L 0
- GFXLIB: DC.B "graphics.library",0
- GFXBASE: DC.L 0
- systemints: dc.l 0
- scroll_offset: dc.l 0
- screenx: dc.l picture
- screeny: dc.l picture2
- letter: dc.b 0
- letter2: dc.b 0
- acurent: dc.l message
- acurent2: dc.l message2
- val: dc.l 0
- val2: dc.l 0
- stopper: dc.l 0
- stopper2: dc.l 0
-
-
- ;BINARY FILES TO BE INCLUDED
- EVEN
- picture
- dcb.b 6000,0
- picture2:
- dcb.b 7000,0
- font
- incbin df1:neatfont.bin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-